package com.ojoin.trade.supplyloan_core.web.service;

import java.util.List;

import org.springframework.data.domain.Pageable;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.service.BaseService;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlLoanStatTotal;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlLoanStatTotalVo;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlLoanStatTotalVoCompare;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlPlatformUser;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 15-10-27
 * Time: 上午9:59
 * To change this template use File | Settings | File Templates.
 */
public interface TbSlLoanStatTotalService extends BaseService<TbSlLoanStatTotal> {
   
   
    
    /**
     * 查询电商平台户业务数据统计
     * @param joinuserNo
     * @throws BusinessException
     */
     
    public List<TbSlLoanStatTotalVo> queryTbSlLoanStatTotalByJoinidAndTime(int joinuserNo,String time) throws BusinessException ;
 
     
 
  
    /**
     * 查询统计数据
     *
     * @param platformUserId 商户id
     * @param statDate   平台
     * * @param statDate  时间
     * @throws BusinessException 
     */
    public List<TbSlLoanStatTotalVo> queryByPlatformAndMerchantUserIDAndDate(String platformName,String  merchantUserId,String statDate) throws BusinessException;
     
    
    public List<TbSlLoanStatTotalVoCompare> queryCompareByPlatformAndMerchantUserIDAndDate(String platformName,String  merchantUserId,String statDate,String endDate,Pageable page) throws BusinessException;

    /**
     * 删除指定商户指定日期的统计数据
     * @param platformUserId
     * @param statDate
     * @throws BusinessException
     */
    public void deleteTbSlLoanTotalByPlatformUserIDAndDate(int platformUserId, String statDate) throws BusinessException;

    /**
     * 根据joinid和平台id查询统计信息
     * @param idOfTbMerchantUser
     * @param idOfPlatformUser
     * @return
     * @throws BusinessException
     */
    public List<TbSlLoanStatTotalVo> queryByJoinidandPlatform(int idOfTbMerchantUser,int idOfPlatformUser,Pageable page)throws BusinessException;


 
    public TbSlLoanStatTotal getTbSlLoanStatTotalVoByPlatformUser(TbSlPlatformUser platformUser);
    
    public TbSlLoanStatTotal queryByPlateIdAndTime(String plateId,String time);  
    
    String getLastInsertTime(int platformAccountId);
}
